package com.i.categoryservice.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.i.categoryservice.mapper.CategoryMapper;
import com.i.categoryservice.service.ICategoryService;
import com.i.piccommon.domain.Category;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author lewis
 * @type class
 * @description
 * @since 2024/10/27
 */
@Service
@RequiredArgsConstructor
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements ICategoryService {
    private final CategoryMapper mapper;
    @Override
    public IPage<Category> searchPhotoByCategory(Category category) {
        IPage<Category> categoryPage = new Page<>(category.getCurrentPage(),category.getPageSize());
        return mapper.searchPhotoByCategory(categoryPage, category.getClassification());
    }
}
